//
//  DYInviteShopListVC.m
//  kafuMerchant
//
//  Created by 帝云科技 on 2018/9/14.
//  Copyright © 2018年 帝云科技. All rights reserved.
//

#import "DYInviteShopListVC.h"
#import "DYInviteCell.h"

@interface DYInviteShopListVC ()

@property (nonatomic,assign)NSInteger page;

@end

@implementation DYInviteShopListVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}
-(void)dy_initData
{
    [super dy_initData];
    
    self.isAddMJFooter=YES;
    //    self.page=1;
    //    [self requestList];
}
-(void)dy_refresh
{
    //    self.page=1;
    //    [self requestList];
}
-(void)dy_loadMore
{
    //    self.page++;
    //    [self requestList];
}
-(void)dy_initUI
{
    [super dy_initUI];
    
    self.tableView.backgroundColor=WhiteColor;
    self.tableView.emptyDataSetSource=self;
    self.tableView.emptyDataSetDelegate=self;
    self.tableView.frame=CGRectMake(0, 0, kScreenWidth, kScreenHeight-kNavigationStatusHeight-BILIHEIGHT(50));
    [self.tableView registerClass:[DYInviteCell class] forCellReuseIdentifier:@"DYInviteCell"];
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    //    if (self.dataArray.count>0) {
    //        return self.dataArray.count+1;
    //    }
    return 4;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row==0) {
        return BILIHEIGHT(45);
    }
    return BILIHEIGHT(33);
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    DYInviteCell *cell=[tableView dequeueReusableCellWithIdentifier:@"DYInviteCell" forIndexPath:indexPath];
    if (indexPath.row>0) {
        //        if (self.dataArray.count>0) {
        //            [cell getInviteModel:(DYCFInviteModel *)self.dataArray[indexPath.row-1]];
        //        }
    }else{
        cell.nameLabel.text=@"用户名";
        cell.timeLabel.text=@"注册时间";
        cell.nameLabel.textColor=[UIColor xhq_aTitle];
        cell.timeLabel.textColor=[UIColor xhq_aTitle];
    }
    return cell;
}
//-(void)requestList
//{
//    if (self.page==1) {
//        [self.dataArray removeAllObjects];
//    }
//    XHQHUDSHOW(self.view);
//    @weakify(self);
//    [AppNetworking requestWithType:HttpRequestTypePost withUrlString:cf_inviteMemberList withParaments:@{@"userid":KUSER_ID,@"now_page":[NSString stringWithFormat:@"%ld",(long)self.page]} withSuccessBlock:^(id json) {
//        XHQHUDHIDE(weak_self.view);
//
//        for (NSDictionary *dic in json[@"info"][@"list"]) {
//            DYCFInviteModel *model=[DYCFInviteModel mj_objectWithKeyValues:dic];
//            [weak_self.dataArray addObject:model];
//        }
//        [weak_self.tableView reloadData];
//
//        if ([json[@"info"][@"page"] integerValue]==self.page||[json[@"info"][@"page"] integerValue]==0) {
//            [weak_self.tableView.mj_footer endRefreshingWithNoMoreData];
//        }
//    } withFailureBlock:^(NSString *errorMessage, int code) {
//        XHQHUDHIDE(weak_self.view);
//    }];
//
//    [self.tableView.mj_footer endRefreshing];
//    [self.tableView.mj_header endRefreshing];
//}

#pragma mark - 暂无数据delegate datasource
-(UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView
{
    return IMG(@"no_data_img");
}
- (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView {
    NSString *title = @"暂无数据";
    NSDictionary *attributes = @{
                                 NSFontAttributeName:kFont(15),
                                 NSForegroundColorAttributeName:[UIColor xhq_content]
                                 };
    return [[NSAttributedString alloc] initWithString:title attributes:attributes];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
